<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "userinfo".
 *
 * @property string $id
 * @property string $nickname
 * @property string $head_portrait
 * @property string $email
 * @property integer $gener
 * @property string $hobby
 * @property string $description
 */
class Userinfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'userinfo';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'nickname', 'head_portrait', 'email', 'gener', 'hobby', 'description'], 'required'],
            [['id', 'gener'], 'integer'],
            [['nickname', 'email'], 'string', 'max' => 30],
            [['head_portrait', 'hobby'], 'string', 'max' => 60],
            [['description'], 'string', 'max' => 200],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => '用户id',
            'nickname' => '昵称',
            'head_portrait' => '头像',
            'email' => '邮箱',
            'gener' => '性别',
            'hobby' => '爱好',
            'description' => '个人描述',
        ];
    }
}
